﻿using System;
using System.Collections.Generic;
using System.Web.Security;
using System.Web.UI;
using BlueMarineWebClient.BlueMarineService;
using BlueMarineWebClient.DO;

namespace BlueMarineWebClient.user
{
    public partial class Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadInformation();
        }

        private void LoadInformation()
        {
            MembershipUser membershipUser = Membership.GetUser();
            if (membershipUser != null)
            {
                Customer cus = ServiceBool.ExService.CustomerGetByAccount(membershipUser.UserName);

               List<CheckIn> listCheckIn =  ServiceBool.ExService.SelectCheckingHistory(cus.CustomerID);
               if (listCheckIn.Count > 0)
               {
                   gvCheckInHistory.DataSource = listCheckIn;
                   gvCheckInHistory.DataBind();
               }
               else lblBokkingHistory.Visible = false;

                lblID.Text = cus.CustomerID.ToString();
                lblName.Text = cus.CustomerName;
                lblIdentify.Text = cus.CustomerIdentifyNo;
                lblPhone.Text = cus.CustomerPhone;
                lblEmail.Text = cus.CustomerEmail;
                lblGender.Text = cus.CustomerSex ? "Male" : "Female";
            }
        }
    }
}